$(function () {
    $('.am-header-title').text('设置');


    var user = JSON.parse(localStorage.getItem("user"));
    if (user == null || user == "null") {
        window.location.href = '../../app/login/login.jsp';
    } else {


        var url = "/h5/getAccount?accountName=" + user.account
        $.post(url, {}, function (result) {
            localStorage.setItem("user", JSON.stringify(result));
            user = result;
            $("#userName").html(user.nickname)
            if (user.headImage != null) {
                $("#head").attr("src", user.headImage);
            }
            $("#lfb").html(user.lfb)
            $("#wdsc").html(user.wdsc)

            if (user.headImage == null) {
                if (user.sex == 1) {
                    $("#head").attr("src", '../../img/head-01.png');
                } else {
                    $("#head").attr("src", '../../img/head-02.png');
                }
            }

        })


    }

    // var url = "/h5/getFavorite"
    // $.post(url, {}, function (result) {
    //
    // })


});

